import axios from 'axios';

axios.interceptors.request.use(function (config) {
  config.headers = {
    'Accept': "application/json, text/plain, */*",
    'Content-Type': "application/json; charset=utf-8",
    'Authorization': localStorage.getItem('pass-key') ? localStorage.getItem('pass-key') : ''
  },
  // config.timeout = 5000,
  config.baseURL = '/api';
  return config;
})

axios.interceptors.response.use( function (response) {
  return response.data
})

export default axios